home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Aminet 1 (Walnut Creek)
/
Aminet - June 1993 [Walnut Creek].iso
/
usenet
/
sources
/
volume90
/
util
/
tracktls
/
part01
/
tfile.doc
< prev
Wrap
Text File
|
1990-01-20
|
6KB
|
130 lines
TFILE -- reserves tracks on a disk
(C) Copyright Eddy Carroll 1990. Freely distributable.
INTRODUCTION
There are occasionally times when you want highspeed access to floppy
disks, and don't want the overhead associated with going through
AmigaDos. One example might be a program to play sound samples
directly from disk (reading in a track's worth of data at a time).
Another example is copying a "minidisk" into RAD: during bootup (see
the documentation for TCOPY for more information on this).
This is fine in theory, but if you go and start using disk tracks for
your own data, sooner or later you're going to overwrite some AmigaDOS
information (or AmigaDOS will overwrite your tracks). What you really
need is a way to tell AmigaDOS not to use the tracks that you are
using.
This is in fact exactly what TFILE does (what a coincidence :-)
It creates a dummy file on a disk that looks to AmigaDOS as if it
contains all the blocks associated with a range of tracks. You can
then happily intermix your private data and standard AmigaDOS files
without any danger of one corrupting the other. For example, if you
have a game that wants direct access to your hard drive, you could
reserve a few cylinders for it to use without having to do a complete
reformat and partition. Similarly for something like AMax.
USAGE
The command template for Tfile looks like this:
tfile <pathname> <start> <end>
<pathname> is the full AmigaDOS pathname of the file you want to
create which will reserve the tracks. You must specify a disk device
(such as DF0:) rather than a volume name. You may like to stick the
file out of the way in the Devs directory or some such place, called
something like TracksX-Y.
<start> and <end> specify the range of tracks to be reserved. When
you run Tfile, these tracks must not be in use by AmigaDOS or Tfile
will complain. Hence, it's a good idea to run Tfile shortly after you
have just formatted a disk, and only then copy over any AmigaDOS files
you want to use (AmigaDOS will arrange them nicely around your reserved
tracks). Obviously, <start> must be less than <end>, and neither can
exceed the number of tracks available on the disk. Tracks are numbered
from 0 upwards, so the 80 tracks on DF0: are numbered 0 to 79.
AmigaDOS usually reserves a few blocks at the start of a disk for
private information. The bootblock on floppy disks is a good example
of this. If the track range you specify includes these reserved blocks,
Tfile will print a warning message. You can safely ignore this -- it is
just there to remind you that you need to be careful writing to the
tracks you specified so as not to overwrite important information.
To make things clearer, a quick example might be useful. Lets suppose
you want to reserve the last 10 tracks on a floppy disk for some
reason (tracks 70 to 79). Just put the disk in DF0: and say
tfile df0:Tracks70-79 70 79
and after a few moments of disk access, you will find yourself with
a new file which is 107848 bytes in size, and a correspondingly
smaller amount of room on the disk.
ADDITIONAL NOTES
Tfile will work with both the old filing system and fast filing system.
On the OFS, if you try to display the dummy file, you will see a brief
message telling you that it isn't a real file, and describing which
tracks it reserves. You will not be able to access anything other
than the message, and it's not a good idea to try and fool AmigaDOS
into letting you.
On the FFS, you will see the same message, but shortly after that will
come the actual raw track data itself. This is due to the different
ways the OFS and FFS store the data blocks of a file. If you have a
file editor such as NewZap, you can even edit the disk blocks directly;
with the exception of the initial "message" block, the blocks are
arranged in sequence from the start to end track.
You can have several different portions of the disk reserved if you
like (you might want to reserve almost all of the disk except for a
little bit in the middle for the AmigaDOS root block).
When you are finished using the tracks, you can release the blocks
back to AmigaDOS by deleting the dummy file.
You may occasionally have trouble finding free room on a disk. David
Gay has written a nice pair of programs which display disk fragmentation
and free blocks. These can be found on Fish Disk 278
under the collective title `frag'.
FUTURE ADDITIONS
One thing I would like to add is the ability to read in a list of
block numbers from a file and reserve those blocks listed, rather
than being restricted to complete tracks. You could then use Tfile
to map out bad blocks on hard drives, in conjunction with some
program that would actually find such blocks for you. As it is,
you could use Tfile to map out bad tracks on AmigaDOS floppies,
but given the cost of blank disks these days and the chances of
a disk with one bad track developing others, it's not really
a sensible gamble.
To add block lists would not be too difficult given the current
implementation; the only thing needed is time. Unfortunately, I don't
have very much of that at the moment, so don't expect them any time soon.
RELEASE HISTORY
V1.0
First release, January 1990. No known bugs, as yet.
AUTHOR
Please direct any praise, criticism, general suggestions or
large sums of money to:
Eddy Carroll
ecarroll@vax1.tcd.ie (Trinity College, Dublin, Ireland)